@extends('admin.common.admin')
@section('cnt')
    {{--面包屑导航--}}
    <nav class="breadcrumb">
        <i class="Hui-iconfont">&#xe67f;</i>管理员管理
        <span class="c-gray en">&gt;</span>添加角色
        <a class="btn btn-success radius r" style="line-height: 1.6em;margin-top:3px"
           href="javascript:location.replace(location.href);" title="刷新">
            <i class="Hui-iconfont">&#xe68f;</i>
        </a>
    </nav>
    <article class="page-container">
        {{--消息提示--}}
        @include('admin.common.msg')
        <form class="from form-horizontal" id="releadd" action="{{route('admin.role.store')}}" method="post">
            @csrf
            <div class="row cl">
                <label class="form-label col-sm-2">
                    <span class="c-red">*</span>角色名称：
                </label>
                <div class="formControls col-sm-8">
                    <input type="text" class="input-text" value="{{old('name')}}" name="name">
                </div>
            </div>
            <div class="row cl" style="margin-top: 20px">
                <div class="col-sm-10 col-sm-offset-2">
                    <input type="submit" class="btn btn-primary radius" value="添加角色">
                </div>
            </div>

        </form>
    </article>
@endsection
@section('js')
    <script>
        //表单验证
        $('#roleadd').validate({
           //验证规则
           rules:{
               name:{
                   required:true,
                   minlength:2
               }
           },
            //取消回车事件
            onkeyup:false,
           //验证成功时的样式名称
            success:'valid',
            //验证成功后，回调事件
            submitHandler:function(form){
               //js表单提交
                form.submit();
            }
        });
    </script>
@endsection
